<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          
 <html xmlns="http://www.w3.org/1999/xhtml" 
 	   xmlns:ui="http://java.sun.com/jsf/facelets"
 	   xmlns:f="http://java.sun.com/jsf/core" 
	   xmlns:h="http://java.sun.com/jsf/html"
	   xmlns:t="http://myfaces.apache.org/tomahawk">
 	<body>
 	<!-- common menu for all pages -->
		<ui:composition>
			<t:panelGrid columns="2">
				<t:outputText value="Id"/> 
				<t:outputText value="#{manageUsersBean.user.id}"/>
				<t:outputText value="Name"/>
				<t:panelGroup>
					<t:inputText id="name" label="name" value="#{manageUsersBean.user.name}">
					</t:inputText>
					<t:message for="name" errorStyle="color:red; text-decoration:overline" />	
				</t:panelGroup>
				<t:outputText value="Password"/>
				<t:panelGroup>
					<t:inputSecret id="password" label="password" value="#{manageUsersBean.password}" validator="#{manageUsersBean.validatePassword}" required="true">
						<f:validateLength minimum="3" maximum="16" />
					</t:inputSecret>
					<t:message for="password" errorStyle="color:red; text-decoration:overline" />	
				</t:panelGroup>
				<t:outputText value="Repeat Password"  />
				<t:panelGroup>
					<t:inputSecret id="password1" label="password1" value="#{manageUsersBean.passwordRepeat}" validator="#{manageUsersBean.validateComparePasswords}" required="true">
						<f:validateLength minimum="3" maximum="16" />
					</t:inputSecret>
					<t:message for="password1" errorStyle="color:red; text-decoration:overline" />
				</t:panelGroup>
				<t:outputText value="Administrative role"/>
				<t:selectBooleanCheckbox value="#{manageUsersBean.user.admin}" />
				<t:outputText value ="Add to product"/>
				<t:selectOneMenu 
						value="#{manageUsersBean.product}" 
						converter="#{manageUsersBean.productConverter}" >
					<f:selectItems value="#{manageUsersBean.productList}" />	
				</t:selectOneMenu>	
		  	 	<t:commandButton action="#{manageUsersBean.editUser}" value="save" />
		   		<t:commandButton action="usersList" value="cancel" immediate="true"/>	 	
	   		</t:panelGrid>	
	   </ui:composition>
   </body>
 </html>